/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fr.monVehicule.coordination.ajouter.vehicule;

import fr.monVehicule.dao.ajouter.VehiculeDAO;
import fr.monVehicule.entite.Vehicule;
import fr.monVehicule.presentation.ajouter.form.VehiculeForm;

/**
 *
 * @author David
 */
public class AjouterVehiculeProcessus {

    private Vehicule vehicule;

    public Vehicule getVehicule() {
        return vehicule;
    }
    public AjouterVehiculeProcessus(VehiculeForm form) {
        vehicule = new Vehicule();
        vehicule.setMarque(form.getMarque());
        vehicule.setModele(form.getModele());
        vehicule.setImmatriculation(form.getImmatriculation());
        vehicule.setKms(form.getKms());
        vehicule.setNumSerie(form.getNumSerie());
        vehicule.setTypeVehicule(form.getTypeVehicule());
        vehicule.setMiseEnCirculation(form.getMiseEnCirculation());
    }
    
    
    public void execute(){
        VehiculeDAO vehiculeDao = new VehiculeDAO();
        vehiculeDao.saveVehicule(this.vehicule);
    }
    
}
